<@override name="head">
<title>总体报表</title>
<link rel="stylesheet" href="${ctx}/assets/css/daterangepicker.css"/>
<script type="text/javascript" src="${ctx}/assets/js/lib/moment.min.js"></script>
<script type="text/javascript" src="${ctx}/assets/js/lib/jquery.daterangepicker.js"></script>
<script type="text/javascript" src="${ctx}/assets/js/lib/date.js"></script>
<script type="text/javascript" src="${ctx}/assets/js/common/dropDownList.js"></script>
<script type="text/javascript" src="${ctx}/assets/js/common/shortcutkey_datePicker.js"></script>
<script type="text/javascript" src="${ctx}/assets/js/report_advertiser.js"></script>
</@override>
<@override name="body">
   <div id=content_bg>
   <#include "/main/home/common.ftl"/>
    <div id="pagecontent">
		<div id="content">
			<div id="selectBar_report" class="selectBar">
				<a class="selectBar_change" href="${ctx}/advertiser/main/ad/report/advertiser-report">总体报表</a>
				<a href="${ctx}/advertiser/main/ad/report/advertiser-report/regionReport">地域报表</a>
				<a href="${ctx}/advertiser/main/ad/report/advertiser-report/osReport">系统报表</a>
				<a href="${ctx}/advertiser/main/ad/report/advertiser-report/sceneReport">场景报表</a>
				<a href="${ctx}/advertiser/main/ad/report/advertiser-report/ideaReport">创意报表</a>
		    </div>
	   		<div id="navDiv">
				<ul id="navDiv_ul">
					<li><i class="icon-home"></i></li>
					<li><a href="${ctx}/advertiser/main/dashboard">首页</a></li>
					<li><i class="icon-angle-right"></i></li>
				    <li class="navDiv_currentLi">数据报表</li>
				</ul>  
 			</div>
	 		<form id="myform" action="${ctx}/advertiser/main/ad/report/advertiser-report" method="post">
	 			<input type="hidden" id="page" name="page" value="${pager.page!}"/>
	 			<input type="hidden" id="dateTab" name="dateTab" value="${dateTab!}"/>
	 			<div id="content_choose">	
					<ul id="main_dimensionul">
						<li class="select_box" id="dimensionul_box">
							<span id="dimensionul_span">${selecteddimensionName!}</span>
							<ul class="son_ul" id="dimension_son_ul"></ul>
						</li>
					</ul>
					<input type="hidden" name="selecteddimensionId" id="dimensionId" value="${dimensionId!}">
					<input type="hidden" name="selecteddimensionName" id="dimensionName" value="${selecteddimensionName!}">
		        	<a class="btn-dimension" href="${ctx}/advertiser/main/ad/report/advertiser-report/dimension">维度管理</a>
					<span id="dateChoose_span">
						<a value="today">今天</a> |
						<a id="yesterday" value="yesterday">昨天</a> |
						<a value="lastSevenDays">前七天</a> |
						<a value="lastWeek">上周</a> |
						<a value="thisMonth">本月</a> |
						<a value="lastMonth">上月</a> 
					</span>
					<span id="calendar_span">
						<i class="icon-calendar"></i>   
						<input type="text" name="dateRangePicker" id="dateRangePicker" value="${dateRangePicker!}" readonly/>
					</span>
					<input id="btn_formSubmit" type="submit" value="查询"/>
				</div>
	 			<div id="selectuls_report">
					<ul id="main_advertiserul">
						<li class="select_box" id="advertiserul_box">
							<span id="advertiserul_span">${selectedadvertiserName!}</span>
							<ul class="son_ul" id="advertiser_son_ul"></ul>
						</li>
					</ul>
					<input type="hidden" name="selectedadvertiserId" id="advertiserId" value="${advertiserId!}"/>
					<ul id="main_orderul">
						<li class="select_box" id="orderul_box">
							<span id="orderul_span">${selectedorderName!}</span>
							<ul class="son_ul" id="orderul_son_ul"></ul>
						</li>
					</ul>
					<input type="hidden" name="selectedorderId" id="orderId" value="${orderId!}"/>
					<ul id="main_adGroupul">
						<li class="select_box" id="adGroupul_box">
							<span id="adGroupul_span">${selectedadGroupName!}</span>
							<ul class="son_ul" id="adGroupul_son_ul"></ul>
						</li>
					</ul>
					<input type="hidden" name="selectedadGroupId" id="adGroupId" value="${adGroupId!}"/>
			   		<div id="date-checkbox">
			   			<span>显示列（此项可多选）</span>
						<input type="checkbox" name="item" value="impression" checked onclick="hideImpression()"/><span>曝光</span>
						<input type="checkbox" name="item" value="click" checked onclick="hideClick()"/><span>点击</span>
						<input type="checkbox" name="item" value="visit" checked onclick="hideVisit()"/><span>到达</span>
						<input type="checkbox" name="item" value="conversion" checked onclick="hideConversion()"/><span>转化</span>
						<input type="checkbox" name="item" value="consume" checked onclick="hideConsume()"/><span>花费</span>
					</div>
		  		</div>
				<table border="1" class="tableFig tableReport">
					<thead>
						<tr class="theadTr">
							<#if dimensionLength ??>
								<th style="width:5%" colspan="${dimensionLength!}"></th>
			            	<#else>
			            		<th style=" width:5%" colspan=1></th>
			            	</#if>
				        	<th class="theadTh hidden-impression" style="width:5%">曝光</th>
				            <th class="theadTh hidden-click" style="width:10%" colspan=2>点击</th>
				            <th class="theadTh hidden-visit" style="width:10%" colspan=2>到达</th>
				            <th class="theadTh hidden-conversion" style="width:10%" colspan=2>转化</th>
				            <th class="theadTh hidden-consume" style="width:10%" colspan=2>花费</th>
						</tr>
						<tr class="theadTr">
							<#if dimensionTarget ??>
							<#list dimensionTarget as dimension>
								<td class="theadTd" style="width:5%">${dimension.dimension!}</td>
							</#list>
		            		<#else>
		            			<td class="theadTd" style="width:5%">日期</td>
		            		</#if>
			                <td class="theadTd hidden-impression" style="width:5%">曝光数</td>
			                <td class="theadTd hidden-click" style="width:5%">点击数</td>
			                <td class="theadTd hidden-click" style="width:5%">点击率</td> 
			                <td class="theadTd hidden-visit" style="width:5%">到达数</td>
			                <td class="theadTd hidden-visit" style="width:5%">到达率</td>   
			                <td class="theadTd hidden-conversion" style="width:5%">转化数</td>
			                <td class="theadTd hidden-conversion" style="width:5%">转化率</td>  
			                <td class="theadTd hidden-consume" style="width:5%">eCPM</td>
			                <td class="theadTd hidden-consume" style="width:5%">花费</td>
			            </tr>
			            <tr class="theadTr">
			            	<#if dimensionTarget ??>
							<#list dimensionTarget as dimension>
								<td class="theadTd">总计</td>
							</#list>
		            		<#else>
		            			 <td class="theadTd">总计</td>
		            		</#if>
		                    <td class="theadTd hidden-impression">${reportMap.impressionSum!}</td>
		                    <td class="theadTd hidden-click">${reportMap.clickSum!}</td>
		                    <td class="theadTd hidden-click">${reportMap.clickRatesum!}%</td> 
		                    <td class="theadTd hidden-visit">${reportMap.visitSum!}</td>
		                    <td class="theadTd hidden-visit">${reportMap.visitRatesum!}%</td>   
		                    <td class="theadTd hidden-conversion">${reportMap.conversionSum!}</td>
		                    <td class="theadTd hidden-conversion">${reportMap.conversionRatesum!}%</td>  
		                    <td class="theadTd hidden-consume">${reportMap.eCmpSum!}</td>
		                    <td class="theadTd hidden-consume">${reportMap.consumeSum!}</td>
	                	</tr>
					</thead>
					<tbody>
						<#if reportList ??>
		            	<#list reportList as report>
						<tr id="tbodyTr">
							<#if dimensionTarget ??>
							<#list dimensionTarget as dimension>
								<#if dimension.dimensionTarget == "reportDate">
								<#setting datetime_format="yyyy-MM-dd"/> 
									<td class="tbodyTd">${report[dimension.dimensionTarget]!?datetime}</td> 
								<#else>
									<td class="tbodyTd">${report[dimension.dimensionTarget]!}</td> 
								</#if>
							</#list>
		            		<#else>
		            			<#setting datetime_format="yyyy-MM-dd"/> 
		            			<td class="tbodyTd">${report.reportDate!?datetime}</td>
		            		</#if>
			                <td class="tbodyTd hidden-impression">${report.impression!}</td>
			                <td class="tbodyTd hidden-click">${report.click!}</td>
			                <td class="tbodyTd hidden-click">${report.clickRate!}%</td>  
			                <td class="tbodyTd hidden-visit">${report.visit!}</td>
			                <td class="tbodyTd hidden-visit">${report.visitRate!}%</td> 
			                <td class="tbodyTd hidden-conversion">${report.conversion!}</td>
			                <td class="tbodyTd hidden-conversion">${report.conversionRate!}%</td>
			               	<td class="tbodyTd hidden-consume">${report.eCmp!}</td>
			                <td class="tbodyTd hidden-consume">${report.consume!}</td>
			            </tr>
						</#list>
						</#if>
					</tbody>
				</table>
		        <div id="exportReport">
					<a id="exportExcel" class="btn_export" href="javascript:void(0);" onClick="exportExcel('total','${ctx}/advertiser/main/ad/report/advertiser-report/exportDataReportExcel')">导出Excel</a>
				</div>
				<div id="pageDiv">
					<#include "/common/pagination/simple.ftl"/>
				</div>
           </form>
		</div>
    </div>
</div>
</@override>
<@extends name="/common/simple.ftl"/>

